<%--
  Created by IntelliJ IDEA.
  User: ernest
  Date: 2018/4/7
  Time: 16:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:include page="include.jsp"></jsp:include>
<html>
<head>
    <title>Title</title>
</head>
<body>

<table class="easyui-datagrid" pagination="true" fitColumns="true" fit="true" id="logDatagrid"
       data-options="url:'getlog',fitColumns:true,singleSelect:true,toolbar:'#tb'">
    <thead>
    <tr>
        <th field="id" checkbox="true"></th>
        <th data-options="field:'operation'">操作</th>
        <th data-options="field:'method'">方法</th>
        <th data-options="field:'params'">参数</th>
    </tr>
    </thead>
</table>
<div id="tb">
    <form id="searchCondition">
        <input  type="hidden" name="logId" id="logId" value="${logId}">
        操作：<input class="easyui-textbox"  name="operation" id="operationSearch">
        <a href="javascript:search()" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
        <a href="javascript:modify()" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</a>
        <a href="javascript:history.go(-1)" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">返回</a>
    </form>
</div>

</body>

<script>
    function search() {
        $("#logDatagrid").datagrid('load', {
            operation: $("#operationSearch").val()
        });
    }
    function modify() {
        var checked = $("input[name='id']:checked");
        if (checked.length == 0) {
            alert("至少选择一个元素！！");
            return false;
        } else if (checked.length > 1) {
            alert("请选择一个元素，您选多了！！");
            return false;
        }
        var logId = checked[0].value;
        window.location.href='logModifyPage?logId='+logId;
    }
</script>
</html>
